package com.xianzhiOA.bean;

import com.xianzhiOA.service.XzEmpService;
import com.xianzhiOA.valid.ValidById;
import net.sf.jsqlparser.expression.DateTimeLiteralExpression;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;

import javax.validation.GroupSequence;
import java.util.Date;

/**
 * Created by Administrator on 2017/4/10.
 */
public class XzEmp {

    private long  empId;
    @NotEmpty(message="真实姓名: 不能为空",groups = {F1.class})
    private  String  empName;
//    @NotEmpty(message="角色: 不能为空",groups = {F1.class})
    private  String  empRole;
    @NotEmpty(message="电话: 不能为空",groups = {F1.class})
    private  String  empTel;
    //  @ValidById(serviceClazz=XzEmpService.class,message="员工工号不能重复",methodName = "selByEmpNo",groups={F2.class})
    // @NotEmpty(message="员工工号: 不能为空",groups = {F1.class})
    private  int empNo;
    @ValidById(serviceClazz=XzEmpService.class,message="员工账号不能重复",methodName = "selByAccount",groups={F2.class})
    private  String  empAccount;
    @NotEmpty(message="员工密码: 不能为空",groups = {F1.class})
    private  String  empPwd;
    private  String  field1;
    private  String  field2;
    private  String  field3;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deleteTime;
    private  Integer isdelete;
    private  Date    createTime;
    private XzRole role;

    @Override
    public String toString() {
        return "XzEmp{" +
                "empId=" + empId +
                ", empName='" + empName + '\'' +
                ", empRole='" + empRole + '\'' +
                ", empTel='" + empTel + '\'' +
                ", empNo=" + empNo +
                ", empAccount='" + empAccount + '\'' +
                ", empPwd='" + empPwd + '\'' +
                ", field1='" + field1 + '\'' +
                ", field2='" + field2 + '\'' +
                ", field3='" + field3 + '\'' +
                ", deleteTime=" + deleteTime +
                ", isdelete=" + isdelete +
                ", createTime=" + createTime +
                ", role=" + role +
                '}';
    }






    public XzRole getRole() {
        return role;
    }

    public void setRole(XzRole role) {
        this.role = role;
    }

    public long getEmpId() {
        return empId;
    }

    public void setEmpId(long empId) {
        this.empId = empId;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public String getEmpRole() {
        return empRole;
    }


    public void setEmpRole(String empRole) {
        this.empRole = empRole;
    }

    public String getEmpTel() {
        return empTel;
    }

    public void setEmpTel(String empTel) {
        this.empTel = empTel;
    }

    public String getEmpAccount() {
        return empAccount;
    }

    public void setEmpAccount(String empAccount) {
        this.empAccount = empAccount;
    }

    public String getEmpPwd() {
        return empPwd;
    }

    public void setEmpPwd(String empPwd) {
        this.empPwd = empPwd;
    }

    public String getField1() {
        return field1;
    }

    public void setField1(String field1) {
        this.field1 = field1;
    }

    public String getField2() {
        return field2;
    }

    public void setField2(String field2) {
        this.field2 = field2;
    }

    public String getField3() {
        return field3;
    }

    public void setField3(String field3) {
        this.field3 = field3;
    }

    public Date getDeleteTime() {
        return deleteTime;
    }

    public void setDeleteTime(Date deleteTime) {
        this.deleteTime = deleteTime;
    }

    public Integer getIsdelete() {
        return isdelete;
    }

    public void setIsdelete(Integer isdelete) {
        this.isdelete = isdelete;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public int getEmpNo() {
        return empNo;
    }

    public void setEmpNo(int empNo) {
        this.empNo = empNo;
    }







    //验证分组1(不能为空)
    public  interface  F1{
    }
    //验证分组2（不能重复）
    public  interface  F2{
    }

    //序列组
      @GroupSequence( { F1.class, F2.class })

    public  interface  Group{
    }





}
